
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>雨寒博客 - 登录</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <link rel="stylesheet" type="text/css" href="/home/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/home/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/home/css/material-design-iconic-font.min.css">
    <link rel="stylesheet" type="text/css" href="/home/css/util.css">
    <link rel="stylesheet" type="text/css" href="/home/css/main.css">
</head>

<body>

<div class="limiter">
    <div class="container-login100" style="background-image: url('/home/images/bg-01.jpg');">
        <div class="wrap-login100 p-l-55 p-r-55 p-t-65 p-b-54">
            <form class="login100-form validate-form"  >
                <span class="login100-form-title p-b-49">雨寒博客-登录</span>

                <div class="wrap-input100 validate-input m-b-23" data-validate="请输入用户名">
                    <input class="input100" type="text" id="user_name" placeholder="请输入用户名" autocomplete="off">
                </div>

                <div class="wrap-input100 validate-input" data-validate="请输入密码">
                    <input class="input100" id="user_pass" name="user_pass" placeholder="请输入密码">
                </div>

                <div class="text-right p-t-8 p-b-31">
                    <a href="javascript:">忘记密码？</a>
                </div>

                <div class="container-login100-form-btn">
                    <div class="wrap-login100-form-btn">
                        <div class="login100-form-bgbtn"></div>
                        <button type="button" class="login100-form-btn"  onclick="dologin()">登 录</button>
                    </div>
                </div>


                <div class="flex-col-c p-t-25">
                    <a href="{{url('index/phoneregister')}}" class="txt2">立即注册</a>
                </div>
            </form>
        </div>
    </div>
</div>

@include('admin.public.script')

<script src="/home/js/jquery.min.js"></script>
<script src="/home/js/main.js"></script>

<div style="text-align:center;">
</div>


<script type="text/javascript"> (function() { var s = "_" + Math.random().toString(36).slice(2); document.write('<div style="" id="' + s + '"></div>'); (window.slotbydup = window.slotbydup || []).push({ id: "u4923786", container:  s }); })(); </script>
<script type="text/javascript" src="/home/js/c.js" async="async" defer="defer" ></script>
</body>

</html>


<script>
    //提交注册

    function dologin()
    {

        var phone = $('#user_name').val();

        var user_pass = $('#user_pass').val();

        if(phone.length == 0){
            layer.msg('请输入账号',{icon:5,time:1000});
            return;
        }

        if(user_pass.length < 6){
            layer.msg('密码最少6位',{icon:5,time:1000});
            return;
        }

        $.ajax({
            'url' : '/index/dologin',
            'type': 'POST',
            'data': {'user_name':phone,'user_pass':user_pass},
            'headers': {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            'dataType': 'json',
            success : function(data){
                if(data.status == 0){
                    layer.msg(data.message,{icon:6,time:1000})
                    window.location.replace('{{url('/index')}}');
                }else{
                    layer.msg(data.message,{icon:6,time:1000})

                }
            },
            error : function(){
                layer.msg('登录失败',{icon:5,time:500})
            }
        })
    }

</script>